package com.yc.zyz.servlet;

import com.google.gson.Gson;
import com.yc.mybatis.damai.MyBatisHelper;
import com.yc.zyz.entity.Task;
import com.yc.zyz.mapper.TaskMapper;
import com.yc.zyz.util.Utils;
import com.yc.zyz.vo.Result;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/7/28
 * Email haijunzhou@hnit.edu.cn
 */
@WebServlet("/myinfo")
public class MyinfoServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Object user = req.getSession().getAttribute("loginedUser");
        if(user == null){
            Utils.print(resp, new Result(0,"未登录",null));
        } else {
            Utils.print(resp, new Result(0,"已登录",user));
        }
    }
}
